import { BaseService, Service } from "@/api/service";

@Service({
	namespace: "open",
})
class Open extends BaseService {
	/**
	 * 图片验证码 base64
	 *
	 * @param {*} { height, width }
	 * @returns
	 * @memberof CommonService
	 */
	captcha({ height, width }: any) {
		return this.request({
			url: "/captcha",
			params: {
				height,
				width
			}
		});
	}

	/**
	 * 用户登录
	 *
	 * @param {*} { username, password, captchaId, verifyCode }
	 * @returns
	 * @memberof CommonService
	 */
	userLogin(data: any) {
		return this.request({
			url: "/login",
			method: "POST",
			data: data
		});
	}
}

export default new Open();
